/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

function compruebaUserPass(user, pass) {
    var expresion_regular_user;
    var expresion_regular_pass;

    expresion_regular_user = /^\d{8}[a-z]$/;

    expresion_regular_pass = /^\d{8}[a-zA-Z0-9]$/;

    var subm = false;
    if (expresion_regular_user.test(user) === false) {
        document.form.username.focus();
        alert("Usuario incorrecto");
        return;
    } else if (expresion_regular_pass.test(pass) === false) {
        document.form.password.focus();
        alert("Contraseña incorrecto");
        return;
    } else {
        subm = true;
    }

    if (subm === true) {
        document.getElementById("formulario-login").submit();
    }
}

